//防止强跳页面
var data=common.getLocalData('H5-agentInfo');
if(!data){
	window.location.href="login.html";
}else{
	var historyAuth=data.isAuth;
	var token=common.getToken();
}
if(data.id && token){
	var url=common.globalHost+common.getAgentDetailPort;
	$.post(url,{id:data.id,token:token},function(resData){
		if(typeof resData=="string"){
			resData=JSON.parse(resData);
		}
		if(resData.code!=0){
			window.location.href='login.html';
		}
		var currentAuth=resData.res.data.isAuth;
		historyAuth==currentAuth?null:window.location.href='login.html';
		if(currentAuth==0){		
			//未认证
			window.location.href="registerInfo.html";
		}else if(currentAuth==1){
			//认证中
			window.location.href="registerAuth.html";
		}else if(currentAuth==2){
			//未通过
			window.location.href="registerFail.html";
		}else if(currentAuth==3){
			//认证通过 停留在当前页面	
		}
	});
}else{
	//如果不存在用户id，就让页面返回到登录页
	window.location.href="login.html";
}